package cn.it62.pojo;

/**
 * @author zhenhuaShen
 * @version 1.0
 * @date 2019/7/31
 * @description cn.it62.pojo
 */
public class Warplane extends Aircraft {
    /**
     * 定义载弹数量、隶属部队、飞行编号
     */
    private int payload;
    private String troops;
    private int id;
    /**
     * 有参构造
     *
     * @param oil
     * @param voyage
     * @param payload
     * @param troops
     * @param id
     */
    public Warplane(String planeName, int oil, int voyage, int payload, String troops, int id) {
        super(planeName, oil, voyage);
        setPayload(payload);
        setTroops(troops);
        setId(id);
    }

    public int getPayload() {
        return payload;
    }

    public void setPayload(int payload) {
        this.payload = payload;
    }

    public String getTroops() {
        return troops;
    }

    public void setTroops(String troops) {
        this.troops = troops;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
    /**
     * 使用airFire方法表示空战功能
     */
    public void airFire() {
        System.out.println(getPlaneName() + "具备空战功能");
    }

    /**
     * toString方法
     * @return
     */
    @Override
    public String toString() {
        return "Warplane{" +
                "planeName='" + getPlaneName()+ '\'' +
                ", oil=" + getOil() +
                ", voyage=" + getVoyage() +
                ",payload=" + payload +
                ", troops='" + troops + '\'' +
                ", id=" + id +
                '}';
    }
}
